<?php

if (isset ($_GET['nom'])) {

	require_once 'connexion.php';
	
	extract($_GET);
	getDonnee($nom);
}else{
	echo "{}";
}

function getDonnee($etu) {
	$sql = "SELECT n.etu, n.note, n.maj, n.exercice
		FROM notes n 
		WHERE n.etu = '".$etu."'";
	
	//echo $sql;
	$rs = mysql_query($sql) or die('Requête invalide : ' . mysql_error());
	$arrG = array();
	While ($arr = mysql_fetch_array($rs)){
		$arrG[] = $arr;
	}
	echo json_encode($arrG);
	
}

?>
